-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stem: Make defines contain :suite.rc
#248
Stem: Make defines contain :suite.rc
#248
Conversation
fd2d3b0
to
6e57e1c
Compare
6e57e1c
to
b539443
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the code breaks if [jinja2:suite.rc]
or [empy:suite.rc]
are specified in the rose-suite.conf
file, but works if [template vars]
is used instead.
These changes switch this the other way around so that [jinja2:suite.rc]
and [empy:suite.rc]
work but [template vars]
is broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but haven't tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original error can still be reproduced on this branch:
$ rose stem --source=mysource=$PWD -S QUESTION='"7 x 6"'
$ cat runN/rose-suite.conf && echo -e '\n\n-----------------\n\n' && cat runN/opt/rose-suite-cylc-install.conf
ROSE_STEM_VERSION=1
# Config Options ' (cylc-install)' from CLI appended to options already in `rose-suite.conf`.
opts=(cylc-install)
[jinja2:suite.rc]
ANSWER=42
-----------------
# This file records CLI Options.
!opts=
[env]
# ROSE_ORIG_HOST set by cylc install.
ROSE_ORIG_HOST=<host>
[jinja2]
...
SITE="meto"
SOURCE_MYSOURCE_MIRROR=""
SOURCE_MYSOURCE_REV=""
[jinja2:suite.rc]
QUESTION="7 x 6"
# ROSE_ORIG_HOST set by cylc install.
ROSE_ORIG_HOST=<host>
@oliver-sanders - I'm terribly sorry that I asked you to review something which was very clearly broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, still haven't tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Got conflicts. Please squash.
24d5024
to
54b0696
Compare
54b0696
to
98b3129
Compare
I think this requires a 5 minute check from @MetRonnie or @oliver-sanders that I haven't messed up the rebase, then merge. |
Rebase is fine. I'm unclear on how to test this. I haven't understood the example from the original issue. |
set -eu
# create an example workflow
cd $(mktemp -d)
mkdir rose-stem
cat > rose-stem/rose-suite.conf <<__HERE__
ROSE_STEM_VERSION=1
[jinja2:suite.rc]
ANSWER=42
__HERE__
touch rose-stem/flow.cylc
# install it
rose stem --source=mysource=$PWD --workflow-name=foo
# inspect the installed config
echo -e '\n\n# rose-suite.conf'
cat ~/cylc-run/foo/runN/rose-suite.conf
echo -e '\n\n# cylc-install opt conf'
cat ~/cylc-run/foo/runN/opt/* Would produce:
Note, the correct To test, try this with each of:
And ensure that the resulting sections match the input name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, think I've got it. With this branch, if I have in rose-suite.conf
[jinja2:suite.rc]
ANSWER=42
then in opt/rose-suite-cylc-install.conf
I get everything in [jinja2:suite.rc]
, (unlike on 1.3.x
where I get some things in [jinja2]
).
And if I have
[template variables]
ANSWER=42
then in opt/rose-suite-cylc-install.conf
I get everything in [template variables]
Any reason not to hit the Big Green Button™ |
Closes #246
Ensure that a
:suite.rc
is added to the template language when creating defines.Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users